def isPrime(x):
    if x == 1:
        return False
    for i in range(2, x):
        if x % i == 0:
            return False
    return True

def resolution1():
    M, N = map(int,input().split())
    sum = 0
    count = 0
    for i in range(M, N+1):
        if isPrime(i):
            sum += i
            count += 1
    print(f"{count} {sum}")


if __name__ == '__main__':
    resolution1()